//
//  Mediator+BKMain.m
//  bestkeep
//
//  Created by 武探 on 2016/11/3.
//  Copyright © 2016年 utouu. All rights reserved.
//

#import "Mediator+BKMain.h"
#import "BKMainAction.h"

NSString *const BKMainTarget = @"BKMainAction";

NSString *const BKMainActionMainViewController = @"mainViewController";
NSString *const BKMainDataRefresh = @"refreshData";

NSString *const BKPhoneCardsTarget = @"BKPhoneCardsAction";

NSString *const BKPhoneCardsViewController = @"phoneCardsViewController";

NSString *const BKFeaturedTarget = @"BKFeaturedAction";

NSString *const BKFeaturedViewController = @"featuredViewController";

NSString *const BKIntegralViewController = @"integralViewController";

NSString *const BKIntegralTarget = @"BKSignAction";

NSString *const BKMainViewControllerCacheKey = @"BKMainViewControllerCacheKey";

@implementation Mediator (BKMain)

-(UIViewController *)BKMain_mainViewController {
    MediatorOptions *options = [MediatorOptions optionsWithTargetName:BKMainTarget actionName:BKMainActionMainViewController];
    options.cacheKey = BKMainViewControllerCacheKey;
    options.shouldCacheTarget = YES;
    
    return [self performWithOptions:options];
}


-(void)BKMain_refreshData{
    MediatorOptions *options = [MediatorOptions optionsWithTargetName:BKMainTarget actionName:BKMainDataRefresh];
    options.cacheKey = BKMainViewControllerCacheKey;
    [self performWithOptions:options];
}


@end

@implementation Mediator(BKPhoneCards)

-(UIViewController*)BKPhoneCardsViewController{
    MediatorOptions *options = [MediatorOptions optionsWithTargetName:BKPhoneCardsTarget actionName:BKPhoneCardsViewController];
    return [self performWithOptions:options];
}


@end

@implementation Mediator(BKSign)


-(UIViewController *)BKIntegralViewController{
     MediatorOptions *options = [MediatorOptions optionsWithTargetName:BKIntegralTarget actionName:BKIntegralViewController];
    return [self performWithOptions:options];
}





@end

@implementation Mediator(BKFeatured)

-(UIViewController *)BKFeaturedViewController{
    MediatorOptions *options = [MediatorOptions optionsWithTargetName:BKFeaturedTarget actionName:BKFeaturedViewController];
    return [self performWithOptions:options];
}

@end





